<?
/**
 * 废弃
 */
exit('已废弃');

class Action{
	private $obj = null;
	private $act = null;
	public function __construct($action){
		$arr = explode('_', $action);
		if(empty($arr[1])){
			$arr = explode('.', $action);
		}
		if(empty($arr[1])){	// 动作不明确
			exit('参数不全');
		}
		
		$clsname = ucwords($arr[0]);
		$clsfile = CLS_PTH."{$clsname}.class.php";
		if(file_exists($clsfile)){
			//try{
				include_once $clsfile;
				if(class_exists($class_name, false)){
					$this->obj = new $clsname();
				}else{
					die('类不存在');
				}
			//}catch(Exception $e){
				//die($e->getMessage());
			//}
		}
		$this->act = $arr[1];
	}
	
	public function doit(){
		if(method_exists ($this->obj, $this->act)){
			$this->obj->act($_POST);
		}
	}
}
?>